import str from './ts/index';
import {funv} from './ts/index'
//  ...作为参数来把传过来的数据变为数组
function sum(...m){
    //console.log(m);
    var sum = 0;
    for(var i of m){
        sum += i;
    }
    console.log(sum);
}
let sum2 = (...m)=>{
    var sum = 0;
    for(var i of m){
        sum += i;
    }
    console.log(sum);
}
// ...展开运算符
let arr1 = [1,2,4];
let arr2 = [1,8,9];
let arr3 = [...arr1,...arr2];
console.log(arr3);
let [x, ...y] = arr3;
console.log(x,y);

sum(6,7,9,8,19,21);
sum2(6,7,9,8,19,21);
// 字符串
let [a1,b,c] = 'ed6'
console.log(a1,b,c);
// 解构赋值
var obj = {
    name:'ywj',
    age:'21'
}
let {name,age} = obj;
console.log(name,age);


console.log(funv("123"));
console.log(str);
const a = '123';
console.log(123);


